#include "Entity.h"

Entity::Entity()
{
}
Entity::Entity(int posX,int posY,int width,int height,Engine* eng)
{
	posRect = new SDL_Rect();
	posRect->x = posX;
	posRect->y = posY;
	posRect->w = width;
	posRect->h = height;
	this->eng = eng;
	bodyClip = new Clip(this);
	weaponClip = new Clip(this);
}

void Entity::draw(SDL_Surface* screen,SDL_Rect* camera)
{
	//Rect temp
	SDL_Rect rectT;
	rectT.x = posRect->x - camera->x;
	rectT.y = posRect->y - camera->y;
	rectT.w = posRect->w;
	rectT.h = posRect->h;
	
   unstate->draw(currentFrame, screen, &rectT);
}

void Entity::setState(State* state)
{
    unstate=state;
}

void Entity::dragged(int x, int y)
{
	posRect->x=posRect->x+x;
	posRect->y=posRect->y+y;
}


Entity::~Entity(){}
